<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>单向绑定</title>
		<script type="text/javascript" src="js/knockout-3.4.0.js" ></script>
	</head>
	<body>
		<div id="_bindDemo">
			姓名:<input type="text" data-bind="attr: {value: name}"></p>
			年龄:<input type="text" data-bind="attr: {value: age}"></p>
		</div>
	</body>
	<script type="text/javascript">
		var data = {
			name: 'lee',
			age: 100
		};
		// 绑定data对象到id为_bindDemo的DOM节点上
		ko.applyBindings(data, document.getElementById('_bindDemo'));
	</script>
</html>
